package week07.data_obs4;

import java.util.Observable;

/**
 * Created by Daniel on 2018/3/13.
 * 被观察者主题
 */
public class Subject extends Observable {
    private String data = "";

    public String getData() {
        return data;
    }

    public void setData(String data) {
        if ( !this.data.equals(data)) {
            this.data = data;
            setChanged();
            notifyObservers();
        }
    }

}
